<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>

    Object.prototype.toString = function() {
        return '我是老大'
    }
    function Person() {
        this.name = 'frank';
    }
    Person.prototype.say = function(){
        console.log('person原型对象中的say方法')
    }
    Person.prototype.toString = function(){
        return 'person原型对象'
    }

    var p = new Person();


    function Admin(){
        this.username = 'Admin';

    }
    var p2 = {
        perm:function(){
            console.log('你没有权限访问')
        }
    };
    Admin.prototype = p;

    var a = new Admin();


    console.log(a)
    console.log(a.toString())
    console.log(a.__proto__)
    console.log(a.__proto__.toString())
    console.log(a.__proto__.__proto__)
    console.log(a.__proto__.__proto__.toString())
    console.log(a.__proto__.__proto__.__proto__)
    console.log(a.__proto__.__proto__.__proto__.toString())
    console.log(a.__proto__.__proto__.__proto__.__proto__)

    /*
    function Person(){
        this.name='frank';
        this.toString = function(){
            return '[object Person]'
        }
    }
    Person.prototype.say = function(){
        console.log(this.name)
    }
    var p1 = new Person();

    function Admin(){
        this.username = 'Admin'
        this.toString = function(){
            return '[object Admin]'
        }
    }
    Admin.prototype = p1;
//    Admin.prototype.constructor = Admin;
    var ad = new Admin();


    console.log(ad);
    console.log(ad.toString());
    console.log(ad.__proto__);
    console.log(ad.__proto__.toString());
    console.log(ad.__proto__.__proto__);
    console.log(ad.__proto__.__proto__.toString());
    console.log(ad.__proto__.__proto__.__proto__);
    console.log(ad.__proto__.__proto__.__proto__.toString());
    console.log(ad.__proto__.__proto__.__proto__.__proto__);
    console.log(ad.__proto__.__proto__.__proto__.__proto__.toString());
    */
</script>
</body>
</html>